package com.hh.releasenode.exception;

import com.hh.releasenode.utils.Response;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.NoHandlerFoundException;

/**
 * @ClassName RNExceptionHandler
 * @Description 全局异常处理
 * @Author KunxianLi
 * Date 2020/6/12 17:53
 * Version 1.0
 **/
@RestControllerAdvice
public class RNExceptionHandler {

    @ExceptionHandler(RNException.class)
    public Response handlerRNException(RNException e){
        Response res = new Response();
        res.setCode(e.getCode());
        res.setMsg(e.getMsg());
        return res;
    }

}
